package com.zhy.greendao.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.zhy.sunmi.bean.Coupons;
import com.zhy.sunmi.bean.Goods;
import com.zhy.sunmi.bean.GoodsCate;
import com.zhy.sunmi.bean.SellGoodHistory;
import com.zhy.sunmi.bean.SoldGoodDetail;
import com.zhy.sunmi.bean.SpStaff;
import com.zhy.sunmi.bean.User;

import com.zhy.greendao.gen.CouponsDao;
import com.zhy.greendao.gen.GoodsDao;
import com.zhy.greendao.gen.GoodsCateDao;
import com.zhy.greendao.gen.SellGoodHistoryDao;
import com.zhy.greendao.gen.SoldGoodDetailDao;
import com.zhy.greendao.gen.SpStaffDao;
import com.zhy.greendao.gen.UserDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig couponsDaoConfig;
    private final DaoConfig goodsDaoConfig;
    private final DaoConfig goodsCateDaoConfig;
    private final DaoConfig sellGoodHistoryDaoConfig;
    private final DaoConfig soldGoodDetailDaoConfig;
    private final DaoConfig spStaffDaoConfig;
    private final DaoConfig userDaoConfig;

    private final CouponsDao couponsDao;
    private final GoodsDao goodsDao;
    private final GoodsCateDao goodsCateDao;
    private final SellGoodHistoryDao sellGoodHistoryDao;
    private final SoldGoodDetailDao soldGoodDetailDao;
    private final SpStaffDao spStaffDao;
    private final UserDao userDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        couponsDaoConfig = daoConfigMap.get(CouponsDao.class).clone();
        couponsDaoConfig.initIdentityScope(type);

        goodsDaoConfig = daoConfigMap.get(GoodsDao.class).clone();
        goodsDaoConfig.initIdentityScope(type);

        goodsCateDaoConfig = daoConfigMap.get(GoodsCateDao.class).clone();
        goodsCateDaoConfig.initIdentityScope(type);

        sellGoodHistoryDaoConfig = daoConfigMap.get(SellGoodHistoryDao.class).clone();
        sellGoodHistoryDaoConfig.initIdentityScope(type);

        soldGoodDetailDaoConfig = daoConfigMap.get(SoldGoodDetailDao.class).clone();
        soldGoodDetailDaoConfig.initIdentityScope(type);

        spStaffDaoConfig = daoConfigMap.get(SpStaffDao.class).clone();
        spStaffDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        couponsDao = new CouponsDao(couponsDaoConfig, this);
        goodsDao = new GoodsDao(goodsDaoConfig, this);
        goodsCateDao = new GoodsCateDao(goodsCateDaoConfig, this);
        sellGoodHistoryDao = new SellGoodHistoryDao(sellGoodHistoryDaoConfig, this);
        soldGoodDetailDao = new SoldGoodDetailDao(soldGoodDetailDaoConfig, this);
        spStaffDao = new SpStaffDao(spStaffDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);

        registerDao(Coupons.class, couponsDao);
        registerDao(Goods.class, goodsDao);
        registerDao(GoodsCate.class, goodsCateDao);
        registerDao(SellGoodHistory.class, sellGoodHistoryDao);
        registerDao(SoldGoodDetail.class, soldGoodDetailDao);
        registerDao(SpStaff.class, spStaffDao);
        registerDao(User.class, userDao);
    }
    
    public void clear() {
        couponsDaoConfig.clearIdentityScope();
        goodsDaoConfig.clearIdentityScope();
        goodsCateDaoConfig.clearIdentityScope();
        sellGoodHistoryDaoConfig.clearIdentityScope();
        soldGoodDetailDaoConfig.clearIdentityScope();
        spStaffDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
    }

    public CouponsDao getCouponsDao() {
        return couponsDao;
    }

    public GoodsDao getGoodsDao() {
        return goodsDao;
    }

    public GoodsCateDao getGoodsCateDao() {
        return goodsCateDao;
    }

    public SellGoodHistoryDao getSellGoodHistoryDao() {
        return sellGoodHistoryDao;
    }

    public SoldGoodDetailDao getSoldGoodDetailDao() {
        return soldGoodDetailDao;
    }

    public SpStaffDao getSpStaffDao() {
        return spStaffDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

}
